
Vue.component('com-header', {
  template: `<div class="header-all">
                <div class="header-logo"><img alt="logo" src="./images/index_logo.png" /></div>
                <ul>
                  <li v-for="(item,index) in navList" :key="'nav' + index" :class="{'act-nav':item.path.includes(activeName)}" @click="toPath(item.path)"> {{item.title}}</li>
                </ul>
                <div class="nav-tips">
                  <div class="line-btn">
                    <span @click="toPath('#')">我要找工作</span>
                    <span @click="toPath('#')">我要招聘</span>
                  </div>
                  <div class="btn-line-primary" @click="toPath('#')">注册/登录</div>
                </div>
            </div>`,
  props: ['activeName'],
  data() {
    return {
      navList: [{
        title: '首页',
        path: 'index.html'
      },{
        title: '国企单位',
        path: 'company.html'
      },{
        title: '在招职位',
        path: 'job.html'
      },{
        title: '人才政策',
        path: 'talent.html'
      },{
        title: '招考资讯',
        path: 'news.html'
      },{
        title: '湘聘活动',
        path: 'activity.html'
      },{
        title: '人才服务',
        path: 'join.html'
      }]
    }
  },
  methods: {
    toPath(path, name = '_self') {
      // 如果新打开页面第二个参数name请传入 _blank
      window.open(path, name)
    }
  }
});

